package com.yun.controller;

import com.yun.entity.User;
import com.yun.mapper.UserMapper;
import com.yun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: fxy
 * @Date: 2023/03/08/14:56
 * @Description:
 */
@RestController
public class TestController {

	@Resource
	private UserMapper userMapper;

	@Autowired
	private UserService userService;

	@GetMapping("/test1")
	public String test1(){
		return "test1";
	}

	@GetMapping("/selectUsers")
	public void selectUsers(){
		List<User> users = userMapper.selectUser();
		List<User> users1 = userMapper.selectUser();
		System.out.println(users);
	}

	@GetMapping("/selectServiceUsers")
	public void selectServiceUsers(){
		List<User> users = userService.selectUsers();
		List<User> users1 = userService.selectUsers();
		System.out.println(users);
	}

	@GetMapping("/selectMapper2Users")
	public void selectMapper2Users(){
		List<User> users = userService.selectMapper2Users();
		System.out.println(users);
	}
}
